home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-10-20 | 3.7 KB | 150 lines | [TEXT/GEOL] |
- Item 6842971 20-Oct-89 09:42
-
- From: D1220 Vari-Lite, Andy Meldrum,PRT
-
- To: MACAPP.TECH$ MACAPP Tech
-
- Sub: Palette Problems (Long!!)
-
- I have a subclass of TWindow, TColBkWindow, where I install a colored
- pixelpattern using the BackPicPat Call. This works fine, & I get the (grey)
- background I want. The window itself is created from a resource description in
- ..makeViews, like this :
-
- SELF.fWindow := NewTemplateWindow(kVisWindowID, SELF);
- { The resource description says the Window is of class TColBkWindow; }
-
-
- Here is the IRes for TColBkWindow :
-
- Procedure TColBkWindow.IRes (itsDocument: TDocument; itsSuperView: TView; Var
- itsParams: Ptr);
- Override;
- { set bkPixPat if we get read in from a resource }
-
- Begin
- Inherited IRes(itsDocument, itsSuperView, itsParams);
- SELF.SetBkPat;
- End;
-
-
- Here is the guts of SetBkPat :
-
- If gConfiguration.HasColorQd Then
- Begin
- fBkPat := GetPixPat(kBkPat); { Load the penpat }
- If fBkPat <> Nil Then { If we get something back }
- Begin
- { Make sure we set our ports bkPat !! }
- GetPort(thePort);
- SetPort(SELF.GetGrafPort);
- BackPixPat(fBkPat); { Install into cGrafPort }
- SetPort(thePort);
- End;
- End;
-
-
- The problem I am having is that when I bring up the color picker the background
- pattern that I have set changes color for the duration that the picker is up.
- However, this is dependent on which background pattern I use. Below are two
- patterns I have tried. "Color Changing" is the one that changes color when I
- bring up the picker with the the (Apple) Video Card in 256 color mode. "Non
- Color Changing" stays the correct color when I bring the picker up with the
- Video Card in 256 colormode. However, this pattern too will change color if I
- set the Video Card to 16 color mode.
-
- Here are two patterns derezzed
- resource 'ppat' (1001, "Color Changing", purgeable) {
- newPattern,
- $"AA 55 AA 55 AA 55 AA 55",
- 4,
- {0, 0, 8, 8},
- 0,
- unpacked,
- 0,
- 0x480000,
- 0x480000,
- chunky,
- 4,
- 1,
- 4,
- 0,
- $"77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77"
- $"77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77",
- 0x81,
- 0,
- { /* array ColorSpec: 8 elements */
- /* [1] */
- 0, 65535, 65535, 65535,
- /* [2] */
- 1, 0, 0, 0,
- /* [3] */
- 2, 38615, 30225, 15517,
- /* [4] */
- 3, 55980, 12316, 12316,
- /* [5] */
- 4, 65535, 62591, 9186,
- /* [6] */
- 5, 65535, 52370, 37885,
- /* [7] */
- 6, 65535, 32767, 0,
- /* [8] */
- 7, 40960, 40960, 40960
- }
- };
-
- resource 'ppat' (1000, "Non Color Changing", purgeable) {
- newPattern,
- $"AA 55 AA 55 AA 55 AA 55",
- 4,
- {0, 0, 8, 8},
- 0,
- unpacked,
- 0,
- 0x480000,
- 0x480000,
- chunky,
- 4,
- 1,
- 4,
- 0,
- $"77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77"
- $"77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77",
- 0x81,
- 0,
- { /* array ColorSpec: 8 elements */
- /* [1] */
- 0, 65535, 65535, 65535,
- /* [2] */
- 1, 0, 0, 0,
- /* [3] */
- 2, 38615, 30225, 15517,
- /* [4] */
- 3, 55980, 12316, 12316,
- /* [5] */
- 4, 65535, 62591, 9186,
- /* [6] */
- 5, 65535, 52370, 37885,
- /* [7] */
- 6, 65535, 32767, 0,
- /* [8] */
- 7, 49152, 49152, 49152
- }
- };
-
-
- I created the 'ppat' by editing the desktop pattern till I got what I wanted &
- then copying the ppat resource from the system.
-
- My question is (finally !! ) .. what is going on. Can someone explain exactly
- why I am seeing what I am. Also ( two questions for the price of one here !! )
- can I stop the bkColor changing when the picker is active !! Any & all
- suggestions gratefuly recieved.
-
- I am doing all of the above on a MacII with QD32 installed, running System
- 6.0.3.
-
- Andy.
-
-
-